/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-10-09 19:31:49
 * @LastEditors: Aroma
 * @LastEditTime: 2024-10-09 19:35:14
 * @别瞎看: 你个无脑牛马
 */

import java.util.HashSet;
import java.util.Set;
import java.util.Random;

/**
  * Test4_2
  */
 public class Test4_2 {
 
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        //随机数
        Random r=new Random();
        int random = 0;
        //判断set大小
        while(set.size()<10){
            //生成随机数
            random=r.nextInt(20)+1;
            //添加到set集合中
            set.add(random);
        }
        //输出set
        System.out.println(set);
    }
 }